package com.bw.skill.mvvm.view;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.blankj.utilcode.util.LogUtils;
import com.bumptech.glide.Glide;
import com.bw.mvvm_common.field.UIField;
import com.bw.mvvm_common.mvvm.view.BaseActivity;
import com.bw.skill.BR;
import com.bw.skill.R;
import com.bw.skill.databinding.ActivitySeckillvaluesBinding;
import com.bw.skill.mvvm.viewmodel.SeckillValuesViewModel;

public
/**
 * @author Lishaohe
 * @description:
 * @date :2021/10/27 0027 上午 10:02
 *
 */
class SeckillvaluesActivity extends BaseActivity<ActivitySeckillvaluesBinding, SeckillValuesViewModel> {

    private LinearLayout llBottom;
    private ImageView seckillimg;
    private TextView mSkuLabelTv;
    private TextView mSkuSelectedTv;
    private ImageView mMoreIv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Bundle bundleExtra = getIntent().getBundleExtra(UIField.PAGEBUNDLE);
        String icon = bundleExtra.getString("icon");
        String sku = bundleExtra.getString("sku");
        String desc = bundleExtra.getString("desc");
        String price = bundleExtra.getString("price");
        int count = bundleExtra.getInt("count");
        int id = bundleExtra.getInt("id");
        long time = bundleExtra.getLong("time");

        vm.seckill(icon, sku, desc, price,count,id,time);
        initView();
        Glide.with(this).load(icon).into(seckillimg);
    }

    @Override
    public int bindLayout() {
        return R.layout.activity_seckillvalues;
    }

    @Override
    public int initVerable() {
        return BR.seckillvm;
    }

    private void initView() {
        llBottom = (LinearLayout) findViewById(R.id.ll_bottom);
        seckillimg = (ImageView) findViewById(R.id.seckillimg);
        mSkuLabelTv = (TextView) findViewById(R.id.mSkuLabelTv);
        mSkuSelectedTv = (TextView) findViewById(R.id.mSkuSelectedTv);
        mMoreIv = (ImageView) findViewById(R.id.mMoreIv);
    }
}
